import axios from "axios";
import { onMounted, ref } from "vue";

export default function useGetDog (){
    const dogUrl = ref("");
    const getDog = async () => {
      const result = await axios.get("https://dog.ceo/api/breeds/image/random");
      dogUrl.value = result.data.message;
    };
    onMounted(() => {
      console.log("dog图片初始化");
    });
    return {dogUrl,getDog}
}